<form id="editForm" class="panel-body form-horizontal form-padding">
						<input type="hidden"  name="#(formModelName).id" class="form-control" value="#(o?o.id:'')">
			                <div class="form-group">
			                    <label class="col-md-2 control-label">申请人</label>
			                    <div class="col-md-4">
			                    	<input type="hidden" id="applyId" name="#(formModelName).userid" class="form-control"  value="#if(o)#(o.userid)#else#(user.id)#end">
			                        <input type="text"  name="#(formModelName).applyer_name" class="form-control"  value="#if(o)#(o.applyer_name)#else#(user.name)#end" readonly>
			                    </div>
			                    <label class="col-md-1 control-label">部门</label>
			                    <div class="col-md-4">
			                        <input type="hidden"  name="#(formModelName).org_id" class="form-control"  value="#if(o)#(o.org_id)#else#(org.id)#end">
			                        <input type="text"  name="#(formModelName).org_name" class="form-control"  value="#if(o)#(o.org_name)#else#(org.name)#end" readonly>
			                    </div>
			                </div>
							<div class="form-group">
								<label class="col-md-2 control-label">职位</label>
								<div class="col-md-2">
									<input type="text" class="form-control"  name="#(formModelName).applyer_position"  value="#if(o)#(o.applyer_position)#else#(user.position)#end" readonly>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 control-label">类型</label>
								<div class="col-md-2">
									<input type="text" class="form-control"  value="#if(type=='1')请假#elseif(type=='2')公出#end" readonly>
									<input type="hidden"  name="#(formModelName).type" class="form-control"  value="#(type)">
								</div>
							</div>
							#if(type=='1')
								#@installDctSelectBtn("请假类型","OA_APPLY_LEAVE_TYPE","leave_type","leave_type_name",o?o.leave_type:"",o?o.leave_type_name:"")
							#end
			                <div class="form-group">
			                    <label class="col-md-2 control-label">申请标题</label>
			                    <div class="col-md-9">
			                        <input type="text"  name="#(formModelName).title" class="form-control"  value="#(o?o.title:'')" #if(view=='detail') readonly #end>
			                        <small class="help-block">请输入申请标题</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">开始时间</label>
					            <div class="input-group date form_datetime col-md-4" style="float:left">
				                    <input type="text" id="startTime" name="#(formModelName).start_time" class="form-control"  value="#(o?o.start_time:'')" readonly>
									<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
				                </div>
			                    <label class="col-md-1 control-label">结束时间</label>
					            <div class="input-group date form_datetime col-md-3" style="float:left">
				                    <input type="text" id="endTime" name="#(formModelName).end_time" class="form-control"  value="#(o?o.end_time:'')" readonly>
									<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
				                </div>
			                </div>
			                #if(type=='2')
								#@installSelectProjectButton(formModelName)
							#end
			                <div class="form-group">
			                    <label class="col-md-2 control-label">天数</label>
			                    <div class="col-md-2">
			                        <input type="text" id="days" name="#(formModelName).days" class="form-control"  value="#(o?o.days:'')"  readonly >
			                    </div>
			                    <label class="control-label" style="text-align:left;">天</label>
<!--			                    <label class="control-label" style="text-align:left;color:red;">#if(type=="1")（剩余可用年假：#(user.year_holiday)天）#end</label>-->
			                    <input type="hidden" value="#(user.year_holiday)" id="yearHoliday">
			                </div>
							<div class="form-group">
								<label class="col-md-2 control-label">代理人</label>
								<div class="col-md-4">
									<div class="input-group mar-btm col-md-12">
										<input type="hidden"  name="#(formModelName).other_user_id" id="other_user_id" class="form-control"  value="#(o?o.other_user_id:'')">
										<input type="text"  name="#(formModelName).other_user_name" id="other_user_name" class="form-control"  value="#(o?o.other_user_name:'')" readonly>
										#if(view!="detail")
										<span class="input-group-btn">
											<button class="btn btn-primary" type="button" onclick="openSelectOneUserForLeave()">选择</button>
										</span>
										#end
									</div>
								</div>
							</div>

			                <div class="form-group">
			                    <label class="col-md-2 control-label">代理事项</label>
			                    <div class="col-md-9">
			                        <textarea rows="8" name="#(formModelName).des" class="form-control" #if(view=='detail') readonly #end>#(o?o.des:'')</textarea>
			                        <small class="help-block">请输入代理事项</small>
			                    </div>
			                </div>
							<div class="form-group">
								<label class="col-md-2 control-label">备注</label>
								<div class="col-md-9">
									<textarea rows="8" name="#(formModelName).note" class="form-control" #if(view=='detail') readonly #end>#(o?o.note:'')</textarea>
									<small class="help-block">请输入备注</small>
								</div>
							</div>
			                <!-- <div class="form-group">
			                    <label class="col-md-2 control-label">上级领导批示</label>
			                    <div class="col-md-9">
			                        <textarea rows="8" name="#(formModelName).leader_message" class="form-control" readonly>#(o?o.leader_message:'')</textarea>
			                        <small class="help-block">请输入领导批示</small>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-md-2 control-label">领导批示</label>
			                    <div class="col-md-9">
			                        <textarea rows="8" name="#(formModelName).leader2_message" class="form-control" readonly>#(o?o.leader2_message:'')</textarea>
			                        <small class="help-block">请输入领导批示</small>
			                    </div>
			                </div> -->
		                	#if(view=='edit')
				            	<div class="panel-footer">
				                    <div class="row">
				                        <div class="col-sm-8 col-sm-offset-3">
				                            <button class="btn btn-warning" type="reset">重置</button>
				                            <button class="btn btn-primary" type="submit" >保存</button>
				                        </div>
				                    </div>
				                </div>
							#else

				            #end
		            </form>
					<script>
						$(document).ready(function() {
							$('.form_datetime').datepicker({format: 'yyyy-mm-dd',weekStart: 1,todayBtn:  1,autoclose: 1,language:  'zh-CN',todayHighlight: 1,forceParse: 0,showMeridian: 1}).on('changeDate',function(){
								var startTime = $("#startTime").val();
								var endTime = $("#endTime").val();
								if(startTime&&endTime){
									if(!dateUtil.compareCalendar(startTime,endTime)){
										pointLion.alertMsg("开始时间大于结束时间","danger",null,null);
										$("#editForm .btn").attr("disabled","disabled");
									}else{
										resetVali();
									}
								}
								var total = dateUtil.timeSubtract(startTime,endTime);
								var day = parseInt(total / (24*60*60))+1;//计算整数天数
								$("#days").val(day);
							});
						});
						function resetVali(){
							if(!$("#editForm").data('bootstrapValidator').isValid()){
								$("#editForm").data('bootstrapValidator').resetForm();
							}
						}
						/***
						 * 选择请假代理人
						 */
						function openSelectOneUserForLeave(){
							pointLion.selectOneUser(encodeURIComponent("root"),function(data){
								$("#other_user_id").val(data.idData);
								$("#other_user_name").val(data.nameData);
							});
						}
					</script>